Network Requests
-
Sends HTTP network requests.
BMSURLSessionis an alternative toBaseRequestthat provides more flexibility and control over requests and their responses.It is built as a wrapper around Swift’s URLSession API that incorporates Bluemix Mobile Services. It automatically gathers Mobile Analytics data on each network request, and can be used to access backends that are protected by Mobile Client Access.
Currently,
See moreBMSURLSessiononly supports URLSessionDataTask and URLSessionUploadTask.Declaration
Swift
public struct BMSURLSession: NetworkSession
-
Sends HTTP network requests.
BaseRequestis a simpler alternative toBMSURLSessionthat requires no familiarity with Swift’s URLSession API.When building a BaseRequest object, all components of the HTTP request must be provided in the initializer, except for the
requestBody, which can be supplied as Data when sending the request viasend(requestBody:completionHandler:).See moreImportant
It is recommended to use theRequestclass instead ofBaseRequest, since it will replaceBaseRequestin the future.Declaration
Swift
open class BaseRequest: NSObject, URLSessionTaskDelegate
-
Sends HTTP network requests.
Requestis functionally equivalent toBaseRequest. For more information on how to useRequest, see the documentation forBaseRequest.Declaration
Swift
open class Request: BaseRequest
View on GitHub
Network Requests Reference